package com.atguign.gulimall.order.web;

import com.atguign.gulimall.order.entity.OrderEntity;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class PageController {
    @Autowired
    RabbitTemplate rabbitTemplate;
    @GetMapping("/test/pay.html")
    @ResponseBody
    public void test(){
        OrderEntity orderEntity = new OrderEntity();
        orderEntity.setOrderSn("asdfasdfasdfase");
        orderEntity.setId(1L);
        System.out.println(orderEntity);
        rabbitTemplate.convertAndSend("order-event-exchange", "order.delay.order", orderEntity);
    }

}
